package com.lfg.leetcode.leetcode500;


public class No717isOneBitCharacter {
    public static void main(String[] args) {
        System.out.println(isOneBitCharacter(new int[]{1, 0, 0}));
    }

    public static boolean isOneBitCharacter(int[] bits) {
        int i = 0;
        while (i < bits.length-1) {
            i += bits[i] + 1;
        }
        return i == bits.length - 1;
    }

}



